#include <set>
#include <iostream>
#include <algorithm>

#include <boost/lambda/lambda.hpp>

using namespace std;
using namespace boost::lambda;

namespace uaa{
struct UAANode
{
   string nodename_;
   size_t refcount_;

   UAANode(string nodename, size_t refcount) : nodename_(nodename), refcount_(refcount) {}

   string getName() const {return nodename_;}
   bool operator < (const UAANode &b) const
   {
      return refcount_ < b.refcount_;
   }
   bool increase() {}
};

ostream& operator << (ostream &os, const UAANode &n)
{
   os << n.getName();
   return os;
}
}

using namespace uaa;

int main()
{
   set<UAANode> nodes;

   nodes.insert(UAANode("n001",0));
   nodes.insert(UAANode("n002",0));
   nodes.insert(UAANode("n003",0));
   nodes.insert(UAANode("n004",0));

   for (int i=0; i< 10; i++) {
      set<UAANode>::iterator it = min_element(nodes.begin(), nodes.end(),  cout << _1 );

//      cout << it->nodename_ << endl;
   }
   return 0;
}
